package com.doit.day03

import scala.util.Sorting

object _02_比较器 {
  def main(args: Array[String]): Unit = {
    val orders: Array[ScalaOrder] = Array(
      ScalaOrder("001", "001", "001", "004", 25, 36),
      ScalaOrder("001", "002", "002", "007", 324, 44),
      ScalaOrder("002", "003", "003", "005", 84, 3),
      ScalaOrder("002", "004", "004", "004", 345, 53),
      ScalaOrder("002", "005", "005", "005", 869, 547),
      ScalaOrder("006", "006", "006", "005", 234, 43),
      ScalaOrder("007", "007", "007", "007", 4441, 168),
      ScalaOrder("008", "008", "008", "006", 656, 43),
      ScalaOrder("008", "009", "009", "006", 112, 75),
      ScalaOrder("010", "010", "010", "005", 312, 43)
    )

    /*Sorting.quickSort(orders)*//*(new Ordering[ScalaOrder] {
      override def compare(x: ScalaOrder, y: ScalaOrder) = -(x.goods_num*x.price).compare(y.goods_num*y.price)
    })*/

    for (elem <- orders) {
      println(elem)
    }

  }
}




case class ScalaOrder(user_id:String,order_id:String,goods_id:String,category_id:String,price:Double,goods_num:Int)